<template>
    <a-collapse :bordered="false">
        <template #expandIcon="props">
            <CaretRightOutlined :rotate="props.isActive ? 90 : 0"/>
        </template>
        <a-collapse-panel key="1" :header="i18n('lineSetting','折线设置')">
            <a-row :gutter="24" style="margin: 0px">
                <a-col :span="12">
                    <a-form-item :label="i18n('width','折线宽度')+'(px)'">
                        <a-input type="number" v-model:value="config.styles.lineConfig.width"></a-input>
                    </a-form-item>
                </a-col>
                <a-col :span="12">
                    <a-form-item :label="i18n('smoothCurve','平滑曲线')">
                        <a-switch size="small" v-model:checked="config.styles.lineConfig.smoothCurve"/>
                    </a-form-item>
                </a-col>
            </a-row>
            <a-row :gutter="24" style="margin: 0px">
                <a-col :span="12">
                    <a-form-item :label="i18n('type','标识类型')">
                        <a-select v-model:value="config.styles.lineConfig.type">
                            <a-select-option value="circle">Circle</a-select-option>
                            <a-select-option value="rect">Rect</a-select-option>
                            <a-select-option value="roundRect">RoundRect</a-select-option>
                            <a-select-option value="triangle">Triangle</a-select-option>
                            <a-select-option value="diamond">Diamond</a-select-option>
                            <a-select-option value="pin">Pin</a-select-option>
                            <a-select-option value="arrow">Arrow</a-select-option>
                            <a-select-option value="emptyCircle">EmptyCircle</a-select-option>
                            <a-select-option value="none">None</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :span="12">
                    <a-form-item :label="i18n('size','标识大小')+'(px)'">
                        <a-input type="number" v-model:value="config.styles.lineConfig.size"></a-input>
                    </a-form-item>
                </a-col>
            </a-row>
        </a-collapse-panel>
    </a-collapse>
</template>

<script>
export default {
    name: "line-config",
    inject: {
        config: {
            default: () => {
                return {};
            }
        }
    },
    data() {
        return {
            lineConfig: {
                width: 1,
                smoothCurve: false,
                type: "circle",
                size: 10,
            }
        }
    },
    created() {
        if (!this.config.styles.lineConfig) {
            this.config.styles["lineConfig"] = this.lineConfig
        }
    },
    methods: {
        i18n(name, text, key) {
            return this.$ti18(name, text, "lineBarLang.lineChartLang", key);
        },
    },
    watch: {}
}
</script>

<style scoped>
</style>
